import 'package:dio/dio.dart';
import 'package:pax_info_app/model/sys_info.dart';

/**
 * header拦截器
 * Created by zongjian
 * Date: 2019-06-18
 */
class HeaderInterceptors extends InterceptorsWrapper {


  @override
  onRequest(RequestOptions options, RequestInterceptorHandler handler) async {
    ///超时
    options.connectTimeout = 30000; // 连接超时时间（毫秒）
    options.receiveTimeout = 30000; // 接收超时时间（毫秒）
    options.headers["Content-Type"] = 'application/json';
    options.headers["ACCEPT"] = 'application/json';
    // options.headers["Accept-Language"] = SysInfo.instance.languageCode == 'zh' ? 'zh_CN' : 'en_US';
    // options.headers["storeId"] = SysInfo.instance.storeId;
    // return options;
    return super.onRequest(options, handler);
  }
}